#pragma once
#include "SensorDataKinectInput.h"
#include "ReconstructByKinectCommonGlobal.h"
#include <XnOS.h>
#include <XnCppWrapper.h>
#include <string>
#include <vector>

class _LIB_CLASS OpenNIContextManager
{
public:

	OpenNIContextManager ();
	~OpenNIContextManager ();

	SensorDataKinectInput *createSensor (const std::string &name,
			const std::string &intrinsicFile = "../Data/Calibration/default.dat",
			const std::string &extrinsicFile = "");
	void start ();
	void update ();

private:
	XnStatus _result;
	xn::Context _context;
	xn::NodeInfoList _deviceInfoList;
	xn::NodeInfoList::Iterator _deviceIter;

	void _checkOpenNIError (const std::string& info);
};

